<% scope[:pipeline].getStageHistory().each do |sim_for_pipeline|
    scope[:html_options] = stage_bar_options(sim_for_pipeline) %>
    <div style='width: <%= stage_width_percent(scope[:pipeline].numberOfStages(), false, 97) %>' class="stage">
        <div class="stage_bar_wrapper">
            <% if placeholder_stage?(sim_for_pipeline) %>
                <div <%= scope[:html_options] -%>></div>
            <% else %>
                <a href="<%= scope[:disable_stage_bar_href] ? '#' : stage_detail_tab_path_for(:pipeline_name => scope[:pipeline].getName(), :pipeline_counter => scope[:pipeline].getCounter(), :stage_name => sim_for_pipeline.getName(), :stage_counter => sim_for_pipeline.getCounter()) -%>">
                    <div <%= scope[:html_options] -%>>
                    </div>
                  </a>
            <% end %>
        </div>
    </div>
<% end %>
<div class="triggered_by">
    <%= trigger_message_with_formatted_date_time(scope[:pipeline].getScheduledDate(), scope[:pipeline].getApprovedBy()) -%>

  <script>
    jQuery(function() {
      jQuery(".triggered_by .time").each(function(idx, timeSpan) {
        var timestamp = parseInt(jQuery(timeSpan).attr("data"));
        if (isNaN(timestamp)) return;
        var time = new Date(timestamp);
        jQuery(timeSpan).text(moment(time).format('DD MMM YYYY [at] HH:mm:ss [Local Time]'));
      });
    });
  </script>
</div>
